//
//  KTDate.h
//
//
//  Created by xu on 8/16/14.
//  Copyright (c) 2014 . All rights reserved.
//

#import <Foundation/Foundation.h>

@interface KTDate : NSObject <NSCopying>

+ (instancetype)dateWithDate:(NSDate *)date;

///当前日期  忽略 时间 2015 01 01
+ (instancetype)dateWithCurrentyyyyMMddDate;

///当前日期 时间 yyyy-MM-dd HH:mm:ss (NSString *)
+ (NSString *)dateWithCurrentyyyyMMddHHmmssString;

///如果为dateFormat nil 默认@"yyyy-MM-dd HH:mm:ss"
+ (instancetype)dateWithDateString:(NSString *)string dateFormat:(NSString *)dateFormat;

///最大努力识别 年月日
+ (instancetype)dateWithDoBestYYYYMMDDDateString:(NSString *)string;

///删除 年月日
- (void)removeDate;
///删除 时分秒
- (void)removeTime;

//距离当前时间多少秒
@property (readonly) NSTimeInterval timeIntervalSinceNow;
@property (readonly) NSTimeInterval timeIntervalSince1970;

///23:44
- (NSString *)hourAndMinitue;
///2000年5月30日
- (NSString *)yearMonthDay;

///5-30
- (NSString *)dateStringWithFormatMMdd;
///2000-5-30 23:44:55
- (NSString *)dateStringWithFormatyyyyMMddHHmmss;
///5-30 23:44
- (NSString *)dateStringWithFormatMMddHHmm;
///2015-07-07 (切勿修改格式,很多请求参数用到)
- (NSString *)dateStringWithFormatyyyyMMdd;
///格式化输出
- (NSString *)dateStringWithDateFormat:(NSString *)dateFormat;

///只比较  时分秒 ...日期不比较
- (NSTimeInterval)timeIntervalSinceDate:(KTDate *)anotherDate ignoreDate:(BOOL)ignoreDate;
///忽略时间  只比较日期
- (NSTimeInterval)timeIntervalIgnoreTimeSinceDate:(KTDate *)anotherDate;
- (NSTimeInterval)timeIntervalNotIgnoreTimeSinceDate:(KTDate *)anotherDate;//比较年月日 时分秒

///当前时间和比较时间的 年月日时分秒
- (NSString *)timeIntervalDescriptionSinceDate:(KTDate *)anotherDate;

///两个日期  相隔的天数
- (NSInteger)daysSinceDate:(KTDate *)startDate;
///判断是否是同一天... 忽略时分秒
- (BOOL)isSameDayWithDate:(KTDate *)anotherDate;

//周几
- (NSString *)weekday;
+ (NSString *)weekdayWithDate:(NSDate *)date;
- (NSString *)weekdayAndDate;
+ (NSString *)weekdayAndDateWithDate:(NSDate *)date;

///星期几
- (NSString *)weekday2;
//201507071314520
+ (NSString *)currentDateTime;

@property (nonatomic,strong) NSDate *date;
///前一天
- (instancetype)previousDays:(NSUInteger)days;
///后一天
- (instancetype)nextDays:(NSUInteger)days;



@end